//
//  ViewController.m
//  06-HomeWork
//
//  Created by 李昊林 on 16/7/21.
//  Copyright © 2016年 李昊林. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    UISegmentedControl *segment = [[UISegmentedControl alloc] initWithItems:@[@"消息",@"电话"]];
    segment.frame = CGRectMake(0, 0, 150, 40);
    self.navigationItem.titleView = segment;
    self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
    self.navigationController.navigationBar.barTintColor = [UIColor colorWithRed:0.000 green:0.627 blue:1.000 alpha:1.000];
    
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithImage:[[UIImage imageNamed:@"scratch"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] style:UIBarButtonItemStylePlain target:self action:@selector(personal:)];
    
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(add:)];
    self.navigationController.navigationBar.barStyle = UIBarStyleBlack;

    
    

    
    
    
}

- (void)personal:(UIBarButtonItem*)barButtonItem {
    NSLog(@"个人信息");
}

- (void)add:(UIBarButtonItem *)barButtonItem {
    NSLog(@"添加");
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
